﻿
@{
    ViewBag.Title = "MyWin";
    Layout = "~/Views/UserInfo/_LayoutUserPanel.cshtml";
    int datanum = ViewBag.DataNum;
}
@section head{
    <link href="~/Content/userpanel-mywin.css" rel="stylesheet" />
}
<div class="mywin">
    <div class="titbar iconfont icon-zhongjiang">中奖记录</div>
    <div class="newjx-area">
    </div>
    <div style="text-align:center;height:50px" id="pagebar" class="layui-pa"></div>
</div>
<script>
    $(function () {
        $("#userpanel-menulist > li:eq(4)").addClass("sel");

        layui.use("laypage", function () {
            var laypage = layui.laypage;
            //完整功能
            laypage.render({
                elem: 'pagebar',
                count: @(datanum),
                limit:10,
                layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip'],
                jump: function (obj) {
                    let pindex = obj.curr;
                    let psize = obj.limit;
                    $.post({
                        url: "/userinfo/MyWinQueryPage",
                        data: {
                            pindex: pindex,
                            psize: psize
                        },
                        dataType: "html",
                        success: function (html) {
                            $(".mywin .newjx-area").html(html);
                        }
                    })
                }
            });
        });
    })
</script>